<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('AgentPaid列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 80px;">结算流水号：</label>
                                <input type="text" name="settleSerial"/>
                            </li>
                            <li>
                                <label style="width: 80px;">代理编号：</label>
                                <input type="text" name="agentNum"/>
                            </li>
                            <li>
                                <label style="width: 80px;">代理名称：</label>
                                <input type="text" name="agentName"/>
                            </li>
                            <li>
                                <label style="width: 80px;">周期</label>
                                <select name="cycle">
                                    <option value="">请选择</option>
                                    <option value="1">月</option>
                                    <option value="0">日</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 80px;">出款状态：</label>
                                <select name="status">
                                    <option value="">请选择</option>
                                    <option value="-1">已上送</option>
                                    <option value="1">出款成功</option>
                                    <option value="-2">出款失败</option>
                                    <option value="0">待处理</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 80px">提现时间：</label>
                                <input type="text" name="startDate" id="startTime" class="time-input" />
                                <span>-</span>
                                <input type="text" name="endDate" id="endTime" class="time-input"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="AgentPaid:agentPaid:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('AgentPaid:agentPaid:edit')}]];
        var removeFlag = [[${@permission.hasPermi('AgentPaid:agentPaid:remove')}]];
        var prefix = ctx + "AgentPaid/agentPaid";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "AgentPaid",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'agentNum',
                    title: '代理编号'
                },
                {
                    field: 'agentName',
                    title: '代理名称'
                },
                {
                    field: 'settleSerial',
                    title: '结算流水号'
                },
                {
                    field: 'cycle',
                    title: '周期',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: blue'>已上送</span>";
                        } else if(value == '1'){
                            return "<span style='color: red'>待处理</span>";
                        } else {
                            return "<span>未知</span>";

                        }
                    }
                },
                {
                    field: 'bankName',
                    title: '开户行名称[账户所属支行]'
                },
                {
                    field: 'screenName',
                    title: '开户人名称'
                },
                {
                    field: 'screenNum',
                    title: '开户行账号'
                },
                {
                    field: 'province',
                    title: '开户省'
                },
                {
                    field: 'city',
                    title: '开户市'
                },
                {
                    field: 'bankNum',
                    title: '支付系统行号'
                },
                {
                    field: 'nature',
                    title: '账户类型 '
                },
                {
                    field: 'auditdate',
                    title: '生成日期'
                },
                {
                    field: 'money',
                    title: '结算金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'payTime',
                    title: '付款时间'
                },
                {
                    field: 'status',
                    title: '出款状态',
                    formatter(value,row,index){
                        if (value == '-1'){
                            return "<span style='color: blue'>已上送</span>";
                        } else if(value == '0'){
                            return "<span style='color: blue'>待处理</span>";
                        } else if(value == '1'){
                            return "<span style='color: green'>出款成功</span>";
                        } else if(value == '-2'){
                            return "<span style='color: red'>出款失败</span>";
                        }
                    }
                },
                {
                    field: 'note',
                    title: '备注'
                },
                {
                    field: 'bankHeadname',
                    title: '总行名称'
                },
                {
                    field: 'showScreennum',
                    title: '展示结算账户号'
                },
                {
                    field: 'acctdate',
                    title: '银联记账日期'
                },
                {
                    field: 'ordernumber',
                    title: '单号'
                },
                {
                    field: 'profitBerfortax',
                    title: '税前利润',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'taxMoney',
                    title: '税金',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.settleSerial + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.settleSerial + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>